﻿<div>
    <ul class="pagination">
        <li class="page-item @(Model.PageIndex==Model.PageStart?"disabled":"")">
            <a asp-route-PageIndex="1" class="page-link">
                <span class="fas fa-fast-backward"></span>
            </a>
        </li>

        <li class="page-item @(Model.PageIndex==1?"disabled":"")">
            <a asp-route-PageIndex="@(Model.PageIndex==1?1:Model.PageIndex-1)" class="page-link">
                <span class="fas fa-backward"></span>
            </a>
        </li>

        @for (int i = Model.PageStart; i <= Model.PageEnd; i++)
        {
            <li class="page-item @(i==Model.PageIndex?"active":"")">
                <a asp-route-PageIndex="@i" asp-route-FilterText="@Model.FilterText"
                   class="page-link">
                    @i
                </a>
            </li>
        }

        <li class="page-item @(Model.PageIndex==Model.PageCount?"disabled":"")">
            <a asp-route-PageIndex="@((Model.PageIndex==Model.PageCount)?Model.PageCount:(Model.PageIndex+1))" class="page-link">
                <span class="fas fa-forward"></span>
            </a>
        </li>

        <li class="page-item @(Model.PageIndex==Model.PageEnd?"disabled":"")">
            <a asp-route-PageIndex="@(Model.PageCount)" class="page-link">
                <span class="fas fa-fast-forward"></span>
            </a>
        </li>

        <li class="page-item">
            <p class="page-link">共 @Model.TotalCount 条，共 @Model.PageCount 页</p>
        </li>
    </ul>
</div>